package com.wxx.design.facade;

/**
 * @author Jetwang
 * @version 1.0
 * @date 2022/4/17 20:41
 */
public class GiftExchangeService {
    private QualifyService qualifyService = new QualifyService();
    private PointsPaymentService pointsPaymentService = new PointsPaymentService();
    private ShippingService shippingService = new ShippingService();

    public void giftExchange(PointsGift pointsGift) {
        if (qualifyService.isAvailable(pointsGift)) {
            // 资格校验通过
            if (pointsPaymentService.pay(pointsGift)) {
                // 积分校验通过
                String orderNo = shippingService.shipGift(pointsGift);
                System.out.println("物流系统下单成功,物流订单号:" + orderNo);
            }
        }
    }
}
